/*
 * Copyright (c) 2024. hallele, Inc All rights reserved.
 */

package cn.hallele.infrastructure.util;

import cn.hallele.infrastructure.util.bean.Captcha;
import org.dromara.hutool.extra.spring.SpringUtil;

/**
 * 验证码工具
 *
 * @author anle5
 * @since 2024/9/15 12:51
 */
public class CaptchaUtil {
    /**
     * 获取默认的验证码,beanName=captcha
     *
     * @return Captcha
     */
    public static Captcha getCaptcha() {
        return SpringUtil.getBean("captcha", Captcha.class);
    }

    /**
     * 获取默认的验证码
     *
     * @param name beanName
     * @return Captcha
     */
    public static Captcha getCaptcha(String name) {
        return SpringUtil.getBean(name, Captcha.class);
    }
}
